namespace SolidMvvm {
	using System;
	using System.Globalization;
	using System.Windows.Data;
	using System.Windows.Media;

	[ValueConversion(typeof(bool), typeof(Brush))]
	public class TrueToValidColorBrushAndFalseToErrorColorBrushConverter : IValueConverter {
		static readonly Brush errorBrush;

		static TrueToValidColorBrushAndFalseToErrorColorBrushConverter() {
			errorBrush = new SolidColorBrush(Color.FromArgb(85, 0xFF, 0x00, 0x00));
			//errorBrush = new LinearGradientBrush() { StartPoint = new Point(0,0), EndPoint = new Point(0, 1) };
			//((LinearGradientBrush)errorBrush).GradientStops.Add(new GradientStop(Colors.Transparent, 0));
			//((LinearGradientBrush)errorBrush).GradientStops.Add(new GradientStop(Colors.LightSalmon, 0.6));
			//((LinearGradientBrush)errorBrush).GradientStops.Add(new GradientStop(Colors.Salmon, 0.8));
			//((LinearGradientBrush)errorBrush).GradientStops.Add(new GradientStop(Colors.LightSalmon, 0.9));
			//((LinearGradientBrush)errorBrush).GradientStops.Add(new GradientStop(Colors.Transparent, 1));

			//errorBrush = new RadialGradientBrush();
			//errorBrush.GradientOrigin = new Point(0.0, 0.5);
			//errorBrush.GradientStops.Add(new GradientStop(Color.FromRgb(0xFF, 0x30, 0x30), 0.5));
			////errorBrush.GradientStops.Add(new GradientStop(Colors.LightYellow, 0.9));
			//errorBrush.GradientStops.Add(new GradientStop(Colors.Transparent, 1));
		}

		public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
			return (bool)value ? parameter : errorBrush;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
			throw new NotImplementedException();
		}
	}
}
